package com.yanfan.modbus.exception;

/**
 * @author oliver foo
 * @description
 * @date 2022/3/15 17:34
 */
public class IllegalFunctionException extends ModbusTransportException {
    private static final long serialVersionUID = -1;

    private final short functionCode;


    public IllegalFunctionException(short functionCode, int slaveId) {
        super("illegal function code: 0x" + Integer.toHexString(functionCode), slaveId);
        this.functionCode = functionCode;
    }


    public short getFunctionCode() {
        return functionCode;
    }
}
